local Enemy = require("Controller/Enemy");
local Boss = require("Controller/Boss");

local EnemyGroup = class("EnemyGroup");

function EnemyGroup:ctor(go)
	self.gameObject = go;
	self.transform = go.transform;
	
	self:InitChild();
end

function EnemyGroup:InitChild()
	local count = self.transform.childCount;
	
	for i = 0, count - 1 do
		local child = self.transform:GetChild(i).gameObject;
		if(child.name == "Enemy") then
			Enemy.new(child);
		elseif(child.name == "Boss") then
			Boss.new(child);
		end
	end
end

function EnemyGroup:ChildCount()
	return self.transform.childCount;
end

function EnemyGroup:Destroy()
	destroy(self.gameObject);
end

return EnemyGroup; 